package com.ece.devirtualizus.Notification;

import android.content.Context;
import android.content.Intent;

import com.ece.devirtualizus.Activities.MainActivity;
import com.ece.devirtualizus.ModelDto.User;
import com.parse.ParsePush;
import com.parse.ParsePushBroadcastReceiver;
import com.parse.ParseUser;

public class NotificationReceiver extends ParsePushBroadcastReceiver {

@Override
public void onPushOpen(Context context, Intent intent) {

Intent activityIntent;
activityIntent = new Intent(context, MainActivity.class);
activityIntent.putExtras(intent.getExtras());
activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
activityIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(activityIntent);

}

static public void pushNotif(String receiverID,String message){
ParsePush push = new ParsePush();
push.setChannel("N_"+receiverID);
push.setMessage(message);
push.sendInBackground();
}
}